import httpRequest from '../request/index'

export function userApi () {
  return {
    login: (params) => {
      return httpRequest({
        url: '/login',
        method: 'post',
        data: params
      })
    },
    checkCode: () => {
      return httpRequest({
        url: '/imageCode',
        method: 'get'
      })
    },
    getUserInfoById: () => {
      return httpRequest({
        url: '/userById',
        method: 'get'
      })
    },
    resetPassword: (data) => {
      return httpRequest({
        url: '/resetPassword',
        method: 'post',
        data
      })
    },
    changeUserInfo: (data) => {
      return httpRequest({
        url: '/user',
        method: 'put',
        data
      })
    }
  }
}
